<!DOCTYPE html>
<html>
<head>
	<meta charset="utf-8">
	<title>懒加载</title>
</head>
<body>
	<div class="img-list">
		<img class="img-item img-item1" src="" data-src='https://www.baidu.com/img/flexible/logo/pc/result.png'>
	</div>
<script>
const lazyload = function(elem) {
	var img = new Image();
	var srcStr = elem.getAttribute('data-src');
	img.src = srcStr;
	img.onload = function() {
		elem.src = srcStr;
	}
};
lazyload(document.querySelector('.img-item1'));
</script>
</body>
</html>